package com.pp.proposalPrint.shared;

import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.pp.proposalPrint.client.MaterialTable;

public class Proposal {

	private String proposalHeader;
	private MaterialTable materialsTable;
//	private Works works;
//	private Rents rent;
	
	public Proposal(String header) {
		this.proposalHeader = header;
		this.materialsTable = new MaterialTable("I Materials");
	}
	
	public void build() {
		loadHeader();
		this.materialsTable.build();
	}

	private void loadHeader() {
		
		VerticalPanel vPnlMain = (VerticalPanel) RootPanel.get("proposalprint").getWidget(0);
		
		// Horizontal panel for header.
		HorizontalPanel hPnlHeader = new HorizontalPanel();
		hPnlHeader.setBorderWidth(1);
		vPnlMain.add(hPnlHeader);
		hPnlHeader.setWidth("100%");
		
		// Header text box.
		TextBox tBoxHeader = new TextBox();
		hPnlHeader.add(tBoxHeader);
		tBoxHeader.setWidth("98%");
		tBoxHeader.setValue(this.proposalHeader);
		tBoxHeader.setTabIndex(1);
		tBoxHeader.setCursorPos(0);
		tBoxHeader.setFocus(true);
	}
	
}
